<?php
/**
 * Created by PhpStorm
 * User: 龍zero
 * Date: 2022-04-21
 * Time: 10:24
 */

namespace App\Request\AppConfig;


use Hyperf\Validation\Request\FormRequest;

class AppConfigRequest  extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        return [
            'logo_img_id' => 'positive',
            'name' => 'required|string|min:2|max:50',
            'tag' => 'required|alpha|min:2|max:50',
            'class_name' => 'requiredIf:login_type,1|string|max:255',
            'app_id' => 'string|min:6|max:20',
            'login_type' => 'in:1,2',
            'remark' => 'string|max:255'
        ];
    }
}